package com.yulang.common.pojo.goods;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * <p>
 * 
 * </p>
 *
 * @author Administrator
 * @since 2019-12-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("tb_album")
public class Album implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @TableId(value = ID, type = IdType.AUTO)
    private Long id;

    /**
     * 相册名称
     */
    @TableField(TITLE)
    private String title;

    /**
     * 相册封面
     */
    @TableField(IMAGE)
    private String image;

    /**
     * 图片列表
     */
    @TableField(IMAGE_ITEMS)
    private String imageItems;


    public static final String ID = "`id`";

    public static final String TITLE = "`title`";

    public static final String IMAGE = "`image`";

    public static final String IMAGE_ITEMS = "`image_items`";


    public static final String ID_COMMENT = "编号";

    public static final String TITLE_COMMENT = "相册名称";

    public static final String IMAGE_COMMENT = "相册封面";

    public static final String IMAGE_ITEMS_COMMENT = "图片列表";



    public static Album of(Object obj) {
        Album e = new Album();
        BeanUtils.copyProperties(obj, e);
        return e;
    }

    public static QueryWrapper<Album> queryWrapper(Object obj) {
        return new QueryWrapper<>(of(obj));
    }

}
